home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / registry.vim < prev    next >
Encoding:
Text File  |  2001-05-11  |  3.3 KB  |  112 lines

  1. " Vim syntax file
  2. " Language:    Windows Registry export with regedit (*.reg)
  3. " Maintainer:    Dominique Stéphan (stephan@my-deja.com)
  4. " URL: http://www.mggen.com/vim/syntax/registry.zip
  5. " Last change:    2001 May 10
  6.  
  7. " clear any unwanted syntax defs
  8. " For version 5.x: Clear all syntax items
  9. " For version 6.x: Quit when a syntax file was already loaded
  10. if version < 600
  11.   syntax clear
  12. elseif exists("b:current_syntax")
  13.   finish
  14. endif
  15.  
  16. " shut case off
  17. syn case ignore
  18.  
  19. " Head of regedit .reg files, it's REGEDIT4 on Win9#/NT
  20. syn match registryHead        "^REGEDIT[0-9]*$"
  21.  
  22. " Comment
  23. syn match  registryComment    "^;.*$"
  24.  
  25. " Registry Key constant
  26. syn keyword registryHKEY    HKEY_LOCAL_MACHINE HKEY_CLASSES_ROOT HKEY_CURRENT_USER
  27. syn keyword registryHKEY    HKEY_USERS HKEY_CURRENT_CONFIG HKEY_DYN_DATA
  28. " Registry Key shortcuts
  29. syn keyword registryHKEY    HKLM HKCR HKCU HKU HKCC HKDD
  30.  
  31. " Some values often found in the registry
  32. " GUID (Global Unique IDentifier)
  33. syn match   registryGUID    "{[0-9A-Fa-f]\{8}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{12}}" contains=registrySpecial
  34.  
  35. " Disk
  36. " syn match   registryDisk    "[a-zA-Z]:\\\\"
  37.  
  38. " Special and Separator characters
  39. syn match   registrySpecial    "\\"
  40. syn match   registrySpecial    "\\\\"
  41. syn match   registrySpecial    "\\\""
  42. syn match   registrySpecial    "\."
  43. syn match   registrySpecial    ","
  44. syn match   registrySpecial    "\/"
  45. syn match   registrySpecial    ":"
  46. syn match   registrySpecial    "-"
  47.  
  48. " String
  49. syn match   registryString    "\".*\"" contains=registryGUID,registrySpecial
  50.  
  51. " Path
  52. syn region  registryPath        start="\[" end="\]" contains=registryHKEY,registryGUID,registrySpecial
  53.  
  54. " Path to remove
  55. " like preceding path but with a "-" at begin
  56. syn region registryRemove    start="\[\-" end="\]" contains=registryHKEY,registryGUID,registrySpecial
  57.  
  58. " Subkey
  59. syn match  registrySubKey            "^\".*\"="
  60. " Default value
  61. syn match  registrySubKey            "^\@="
  62.  
  63. " Numbers
  64.  
  65. " Hex or Binary
  66. " The format can be precised between () :
  67. " 0    REG_NONE
  68. " 1    REG_SZ
  69. " 2    REG_EXPAND_SZ
  70. " 3    REG_BINARY
  71. " 4    REG_DWORD, REG_DWORD_LITTLE_ENDIAN
  72. " 5    REG_DWORD_BIG_ENDIAN
  73. " 6    REG_LINK
  74. " 7    REG_MULTI_SZ
  75. " 8    REG_RESOURCE_LIST
  76. " 9    REG_FULL_RESOURCE_DESCRIPTOR
  77. " 10   REG_RESOURCE_REQUIREMENTS_LIST
  78. " The value can take several lines, if \ ends the line
  79. syn match registryHex        "hex\(([0-9]\{0,2})\)\=:\([0-9a-fA-F]\{2},\)*\([0-9a-fA-F]\{2}\|\\\)$" contains=registrySpecial
  80. syn match registryHex        "^\s*\([0-9a-fA-F]\{2},\)*\([0-9a-fA-F]\{2}\|\\\)$" contains=registrySpecial
  81. " Dword (32 bits)
  82. syn match registryDword        "dword:[0-9a-fA-F]\{8}$" contains=registrySpecial
  83.  
  84. if version >= 508 || !exists("did_registry_syntax_inits")
  85.   if version < 508
  86.     let did_registry_syntax_inits = 1
  87.     command -nargs=+ HiLink hi link <args>
  88.   else
  89.     command -nargs=+ HiLink hi def link <args>
  90.   endif
  91.  
  92. " The default methods for highlighting.  Can be overridden later
  93.    HiLink registryComment    Comment
  94.    HiLink registryHead            Constant
  95.    HiLink registryHKEY          Constant
  96.    HiLink registryPath          Special
  97.    HiLink registryRemove        PreProc
  98.    HiLink registryGUID          Identifier
  99.    HiLink registrySpecial       Special
  100.    HiLink registrySubKey        Type
  101.    HiLink registryString        String
  102.    HiLink registryHex           Number
  103.    HiLink registryDword         Number
  104.  
  105.    delcommand HiLink
  106. endif
  107.  
  108.  
  109. let b:current_syntax = "registry"
  110.  
  111. " vim:ts=8
  112.